package com.globallogic.training.javase.easymock;

import java.util.Set;
import java.util.TreeSet;

public class Curriculum {
	
	private Set<Subject> subjects = new TreeSet<Subject>();
	
	public boolean addSubject(Subject s) {
		if (s == null) {
			return false;
		}
		
		return subjects.add(s);
	}
	
	public boolean removeSubject(Subject s) {
		return subjects.remove(s);
	}
	
	public Subject getSubject(Subject s) {
		if (s != null) {
			for (Subject subj : subjects) {
				if (subj.equals(s)) {
					return subj;
				}
			}
		}
		return null;
	}
	
	public Set<Subject> getCurriculum() {
		return subjects;
	}
	
}
